//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace WorkflowApplication.Interfaces
{
    using Microsoft.Research.DataLayer;
    using System.Collections.ObjectModel;
    using System;
    using System.Collections.Generic;
    using WorkflowApplicationModels;

    /// <summary>
    /// Interface for the registry service.
    /// </summary>
    public interface IRegistryService
    {
        /// <summary>
        /// Gets or sets the current connection.
        /// </summary>
        /// <value>The current connection.</value>
        Connection CurrentConnection { get; set; }

        /// <summary>
        /// Get the workflow category root.
        /// </summary>
        /// <returns>
        /// Workflow root category.
        /// </returns>
        void GetWorkflowCategories(Collection<Namespace> categories);

        /// <summary>
        /// Gets all guest users.
        /// </summary>
        /// <returns></returns>
        Collection<User> GetAllGuests();

        /// <summary>
        /// Gets all authenticated users.
        /// </summary>
        /// <returns></returns>
        Collection<User> GetAllAuthenticatedUsers();

        /// <summary>
        /// Gets the users my workflows.
        /// </summary>
        /// <param name="categories">The categories.</param>
        void GetMyWorkflowsForCurrentUser(Collection<Namespace> categories);

        /// <summary>
        /// Gets all users my workflows.
        /// </summary>
        /// <param name="categories">The categories.</param>
        void GetAllUsersMyWorkflows(Collection<Namespace> categories);

        /// <summary>
        /// Gets all machines.
        /// </summary>
        /// <returns></returns>
        Collection<MachineModel> GetAllMachines(bool isInteractive);

        /// <summary>
        /// Gets the workflow.
        /// </summary>
        /// <param name="guid">The GUID.</param>
        /// <returns></returns>
        Activity GetWorkflow(Guid workflowId);

        /// <summary>
        /// Gets all shared workflows.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        ICollection<Activity> GetAllSharedWorkflowsForCurrentUser();

        /// <summary>
        /// Fetches the current user.
        /// </summary>
        /// <returns></returns>
        User FetchCurrentUser();
    }
}
